<?php
header("Content-Type: text/html");
header("charset: utf-8");
include_once("_common.php");

$sql = " select count(*) cnt from g4_scrap where mb_id = '$mb_id' and bo_table = '$bo_table' and wr_id = '$wr_id' ";
$row = sql_fetch($sql);
$ajax_cnt = $row['cnt'];

if($ajax_cnt == "0"){
	$sql = " insert into g4_scrap ( mb_id, bo_table, wr_id, ms_datetime )
    	     values ( '$mb_id', '$bo_table', '$wr_id', now() ) ";
	sql_query($sql);
}

echo $ajax_cnt;
?>